package com.sanqi.work.service.impl;

import java.util.List;
import com.sanqi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.sanqi.work.mapper.WorkUserMapper;
import com.sanqi.work.domain.WorkUser;
import com.sanqi.work.service.IWorkUserService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;

/**
 * 员工Service业务层处理
 * 
 * @author duany
 * @date 2025-09-24
 */
@Service
public class WorkUserServiceImpl extends ServiceImpl<WorkUserMapper, WorkUser> implements IWorkUserService 
{
    @Autowired
    private WorkUserMapper workUserMapper;

    /**
     * 查询员工
     * 
     * @param id 员工主键
     * @return 员工
     */
    @Override
    public WorkUser selectWorkUserById(String id)
    {
        return workUserMapper.selectWorkUserById(id);
    }

    /**
     * 查询员工列表
     * 
     * @param workUser 员工
     * @return 员工
     */
    @Override
    public List<WorkUser> selectWorkUserList(WorkUser workUser)
    {
        return workUserMapper.selectWorkUserList(workUser);
    }

    /**
     * 新增员工
     * 
     * @param workUser 员工
     * @return 结果
     */
    @Override
    public int insertWorkUser(WorkUser workUser)
    {
        workUser.setCreateTime(DateUtils.getNowDate());
        return workUserMapper.insertWorkUser(workUser);
    }

    /**
     * 修改员工
     * 
     * @param workUser 员工
     * @return 结果
     */
    @Override
    public int updateWorkUser(WorkUser workUser)
    {
        workUser.setUpdateTime(DateUtils.getNowDate());
        return workUserMapper.updateWorkUser(workUser);
    }

    /**
     * 批量删除员工
     * 
     * @param ids 需要删除的员工主键
     * @return 结果
     */
    @Override
    public int deleteWorkUserByIds(String[] ids)
    {
        return workUserMapper.deleteWorkUserByIds(ids);
    }

    /**
     * 删除员工信息
     * 
     * @param id 员工主键
     * @return 结果
     */
    @Override
    public int deleteWorkUserById(String id)
    {
        return workUserMapper.deleteWorkUserById(id);
    }
}
